<?php 
include_once(''.P.'/public/header.html');
?>

<script type="text/javascript" src="res/bootstrapplugin/jquery-bootstable.js"></script>


<script>

function initbody(){
	deleterecordurl = '?m=dept&d=manage&cnum='+cnum+'&a=deldept';
	table = $('#viewshow').bootstable({
		url:'?m=dept&d=manage&cnum='+cnum+'&a=data',method:'get',celleditor:true,tablename:'6',
		cellurl:'index.php',fanye:false,cellurl:'index.php?a=savecell',tree:true,
		columns:[{
			text:'名称',dataIndex:'name',align:'left'
		},{
			text:'编号',dataIndex:'num',editor:true
		},{
			text:'负责人',dataIndex:'headman'
		},{
			text:'状态',dataIndex:'status',sortable:true,type:'checkbox',editor:true
		},{
			text:'排序号',dataIndex:'sort',sortable:true,type:'number',editor:true,textmsg:'越小越靠前'
		},{
			text:'ID',dataIndex:'id'
		},{
			text:'',dataIndex:'opts',align:'left',renderer:function(s,d){
				var str = '<a class="zhu" href="?m=dept&d=manage&cnum='+cnum+'&a=form&id='+d.id+'">编辑</a>&nbsp;';
				str += '<a class="zhu" href="?m=dept&d=manage&cnum='+cnum+'&a=form&pid='+d.id+'">加下级</a>&nbsp;';
				if(d.id!=1)str+='<a class="zhu" href="javascript:;" onclick="deleterecord('+d.id+',deleterecordurl,false)">删</a>';
				return str;
			}
		}]
	});
}


</script>
</head>

<body>

<?php 
include_once(''.P.'/public/top_manage.html');
?>

<div align="center">

<div style="width:<?=$maxwidth?>;margin:20px 0px" align="left">
	<div style="color:#cccccc">
		<a href="?d=manage&cnum=<?=$cnum?>" class="zhu"><?=lang('manage.home')?></a> &gt;
		<a href="" class="zhu"><?=lang('manage.dept')?></a>
	</div>
	<div class="mainbody">
	
		<div style="padding:10px">
			<div style="padding:5px 0px">
			<table width="100%"><tr>
			<td align="left">
			<a class="webbtn" style="border-radius:5px" href="javascript:;" onclick="table.reload()">刷新</a>
			</td>
			<td align="right">
			
			</td>
			</tr>
			</table>
			
			
			
			</div>
			<div class="blank10"></div>
			<div id="viewshow"></div>
		</div>
		<div class="blank10"></div>
	</div>
</div>



<?php 
include_once(''.P.'/public/footer.html');
?>
</div>

</body>
</html>